//
//  UIBarButtonItem+item.m
//  项目模板
//
//  Created by ZHM on 14/12/31.
//  Copyright © 2014年 ZHM. All rights reserved.
//

#import "UIBarButtonItem+item.h"

@implementation UIBarButtonItem (item)
+ (UIBarButtonItem *)barButtonItemWithImage:(UIImage *)image highImage:(UIImage *)highImage target:(id)target action:(SEL)attion forControlEvents:(UIControlEvents)controlEvents {
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    [btn setBackgroundImage:image forState:UIControlStateNormal];
    [btn setBackgroundImage:highImage forState:UIControlStateHighlighted];
    [btn sizeToFit];
    [btn addTarget:target action:attion forControlEvents:controlEvents];
    return [[UIBarButtonItem alloc] initWithCustomView:btn];
}
@end
